Some(ref toml) => add_unused_keys(&mut manifest, toml, "".to_string()),
None => {}
}
- if manifest.get_targets().len() == 0 {
+ if manifest.get_targets().iter()
+ .filter(|t| !t.get_profile().is_custom_build() )
+ .next().is_none() {
return Err(human(format!("either a [lib] or [[bin]] section must \
be present")))
}
assert_that(p.cargo_process("build").arg("-v").arg("--release"),
execs().with_status(0));
})
+
+test!(build_script_only {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [project]
+ name = "foo"
+ version = "0.0.0"
+ authors = []
+ build = "build.rs"
+ "#)
+ .file("build.rs", r#"fn main() {}"#);
+ assert_that(p.cargo_process("build").arg("-v"),
+ execs().with_status(101)
+ .with_stderr("either a [lib] or [[bin]] section must \
+ be present"));
+})